package com.gragra.cooccClustering.tests;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import org.junit.Test;
import com.gragra.cooccClustering.CRPClustering;
import com.gragra.parseOptions.CommandLineException;
import com.gragra.parseOptions.Parser;
/**
 * 
 * @author Christoph Teichmann
 * 14.10.2013
 */
public class TestCRPClustering
{
	@Test
	public void test() throws CommandLineException, IOException, InterruptedException
	{
		CRPClustering ccl = new CRPClustering();
		Parser pa = new Parser();
		ccl.addOptions(pa);
		ObjectArrayList<String> list = new ObjectArrayList<String>();
		list.add("0.1");
		pa.setOption("lconc", list);
		list.clear();
		list.add("0.01");
		pa.setOption("conc", list);
		list.clear();
		list.add("0.3");
		pa.setOption("annealRed", list);
		list.clear();
		list.add("7");
		pa.setOption("t", list);
		list.clear();
		list.add("200");
		pa.setOption("burnIn", list);
		list.clear();
		list.add("3");
		pa.setOption("winSize", list);
		list.clear();
		pa.setOption("toLower", list);
		list.add("7");
		pa.setOption("rank", list);
		list.clear();
		list.add("2");
		pa.setOption("useSuffix", list);
		list.clear();
		list.add("0.6");
		pa.setOption("annFinal", list);
		list.clear();
		list.add("100");
		pa.setOption("samp", list);
		list.clear();
		list.add("4");
		pa.setOption("numLab", list);
		list.clear();
		list.add("13.0");
		pa.setOption("annStart", list);
		StringWriter sw = new StringWriter();
		BufferedWriter bw = new BufferedWriter(sw);
		StringReader sr = new StringReader("Hans|0 hat|0 gestern|0 die|0 Schule|0 besucht|0 .|0\r\n" +
				"Fritz|0 hat|0 gestern|0 seinen|0 Onkel|0 besucht|0 .|0\r\n" +
				"Marie|0 hat|0 gestern|0 einen|0 Kuchen|0 gebacken|0 .|0\r\n" +
				"Ich|0 habe|0 gestern|0 einen|0 Elefanten|0 gejagt|0 .|0\r\n" +
				"Du|0 hast|0 gestern|0 zwei|0 Flaschen|0 geleert|0 .|0\r\n");
		BufferedReader br = new BufferedReader(sr);
		ccl.annotate(br, bw, pa);
		br.close();
		bw.close();
	}
}